import request from '@/utils/request'
import wechath5 from '@/utils/wechath5'
import store from 'store'

// 账号登录
export const apiAccountLogin = data => 
	request.post("login/account", {...data})
	
// 重置登录密码
export const apiResetPassword = data => 
	request.post("Setting/resetPassword", data)


// 获取服务协议
export const apiPolicyAgreement = (params) => request.get('config/getPolicyAgreement', {params})

// 获取系统配置
export const apiConfig = () => request.get('config/getConfig')

// 支付方式
export const apiPayway = (params) =>
    request.get('pay/payway', {
        params: { ...params, scene: store.getters.client }
    })

// 预支付
export const apiPrepay = (params, token) =>
    request.post(
        'pay/prepay',
        {
            ...params,
            order_source: store.getters.client
        },
        { headers: { token } }
    )
		
export const apiUnionPrepay = (params, token) =>
    request.post(
				'unionPay/prepay',
        {
            ...params,
            order_source: store.getters.client
        },
        { headers: { token } }
    )

// 支付结果查询
export const apiPayStatus = (params) => request.get('pay/payStatus', { params })

export const apiPayResult = (params) => request.get('pay/payResult', { params })
